﻿using System.Collections.Generic;
using System.Linq;
using Dexter.DataTransferObject;
using Dexter.Domain.Model;
using Dexter.Services;
using Dexter.Web.Mvc.ViewModel.Backoffice.Binders;
using Dexter.Web.Mvc.ViewModel.Backoffice.ViewsData.PostController;
using Dexter.Web.Mvc.ViewModel.ViewsData;
using Dexter.Web.Mvc.ViewsData;
using Dexter.Web.Utils;

namespace Dexter.Web.Mvc.ViewModel.Backoffice.ViewsData.PageController {
	public class PageEditorViewData : BackOfficeBaseViewData {
		public PageEditorViewData ( IWebUtils webUtils, SiteConfiguration configuration, IUrlBuilder urlBuilder ) : base ( webUtils, configuration, urlBuilder ) { }

		internal static readonly string[] HoursValues = { "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23" };

		internal static readonly string[] MinutesValues = {
		                                  				"00" , "01" , "02" , "03" , "04" , "05" , "06" , "07" , "08" , "09" , "10" ,
		                                  				"11" , "12" , "13" , "14" , "15" , "16" , "17" , "18" , "19" , "20" , "21" ,
		                                  				"22" , "23" , "24" , "25" , "26" , "27" , "28" , "29" , "30" , "31" , "32" ,
														"33" , "34" , "35" , "36" , "37" , "38" , "39" , "40" , "41" , "42" , "43" ,
														"44" , "45" , "46" , "47" , "48" , "49" , "50" , "51" , "52" , "53" , "54" ,
														"55" , "56" , "57" , "58" , "59"
													  };
		public string[] Hours {
			get { return PostEditorViewData.HoursValues; }
		}

		public string[] Minutes {
			get { return PostEditorViewData.MinutesValues; }
		}

		public IEnumerable<PageStructureDto> Pages { get; set; }
		public IEnumerable<PageStructureDto> FlatPages { get { return Pages.ToFlat ( x => x.Pages ); } }
		public PageBinder Page { get; set; }
	}
}